﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'usp_UPDMS_REF_TOUR_Update')
	BEGIN
		DROP Procedure usp_UPDMS_REF_TOUR_Update
	END
GO

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
/******************************************************************************
**	Name : usp_UPDMS_REF_TOUR_Update
**	Desc : 기행기를 수정한다.
**	Test Exec Query : Exec usp_UPDMS_REF_TOUR_Update
**	Called by : Ref_Dac_UPDMS_REF_TOUR.cs
**	Program ID : Ref1012m
**	Auth : 송시명
**	Date : 2013-04-17
*******************************************************************************
**	Change History
*******************************************************************************
**	Date:		Author:		Description:
**	--------	--------	---------------------------------------
**	
*******************************************************************************/
CREATE PROC [dbo].[usp_UPDMS_REF_TOUR_Update]
@Seq int,
@Shop_Id nvarchar(5),
@Nick_Nm nvarchar(200),
@Running_Time int,
@Tour_Dt nvarchar(10),
@Tour_Hour nvarchar(2),
@Tour_Minute nvarchar(2),
@Place nvarchar(50),
@Price int,
@HomeRun_Yn nvarchar(5),
@Satisfaction nvarchar(5),
@Contents nvarchar(max),
@Keyword nvarchar(2000),
@Latitude nvarchar(50),
@Longitude nvarchar(50),
@Attach_File_Info nvarchar(MAX),
@Create_User nvarchar(20),
@Create_Dt datetime,
@Update_User nvarchar(20),
@Update_Dt datetime
AS
SET NOCOUNT OFF

UPDATE UPDMS_REF_TOUR
   SET Shop_Id = @Shop_Id,
       Nick_Nm = @Nick_Nm,
       Running_Time = @Running_Time,
       Tour_Dt = @Tour_Dt,
       Tour_Hour = @Tour_Hour,
       Tour_Minute = @Tour_Minute,
       Place = @Place,
       Price = @Price,
       HomeRun_Yn = @HomeRun_Yn,
       Satisfaction = @Satisfaction,
       Contents = @Contents,
       Keyword = @Keyword,
       Latitude = @Latitude,
       Longitude = @Longitude,
       Update_User = @Update_User,
       Update_Dt = GETDATE()
 WHERE Seq = @Seq

--첨부파일 저장
EXEC usp_UPDMS_COM_FILE_Insert_Xml @Seq, 'Ref1012m', @Attach_File_Info

GO